package com.person.leetcode.editor.cn;

/**
  * 713.乘积小于 K 的子数组
  * 2022-05-05 15:33:28
**/
public class Sequence_0713_SubarrayProductLessThanK {
    public static void main(String[] args) {
        Solution solution = new Sequence_0713_SubarrayProductLessThanK().new Solution();
    }
    //leetcode submit region begin(Prohibit modification and deletion)

    /**
     * 最容易的中等题
     */
    class Solution {
    public int numSubarrayProductLessThanK(int[] nums, int k) {
        int res = 0;
        for (int i = 0; i < nums.length; i++) {
            int product = 1;
            for (int j = i; j < nums.length; j++) {
                product *= nums[j];
                if (product < k){
                    res ++;
                }else{
                    break;
                }
            }
        }
        return res;
    }
}
//leetcode submit region end(Prohibit modification and deletion)
}
